package com.ly.hotel.model;

import android.text.TextUtils;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;


public class Episodepart implements Serializable {
	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

	private Double cost;
	private String path;
	private Vodpart movieType;
	private List<VodVideoBean> vodVideoBeanList;
	private String introContent;
	// Constructors

	/** default constructor */
	public Episodepart() {

	}

	/*获取服务器的端口号*/
	public String getServerPort() {
		int v = (int)cost.longValue();
		String port = Integer.toString(v);
		return port;
	}

	public String getPath() {
		String img = "";
		if(!TextUtils.isEmpty(path)){
			String p[] = path.split("/");
			p[p.length-1] = "poster.jpg";
			img = org.apache.commons.lang3.StringUtils.join(p, "/");
		}
		return img;
	}

	public String getIntroPath() {
		String intro = "";
		if(!TextUtils.isEmpty(path)){
			String p[] = path.split("/");
			p[p.length-1] = "intro.xml";
			intro = org.apache.commons.lang3.StringUtils.join(p, "/");
		}
		return intro;
	}

	public List<VodVideoBean> getVodvideoBeanList() {
		return vodVideoBeanList;
	}

	public void addVodvideoBean(VodVideoBean vvb) {
		if(this.vodVideoBeanList != null){
			this.vodVideoBeanList.add(vvb);
		}else{
			this.vodVideoBeanList = new ArrayList<VodVideoBean>();
			this.vodVideoBeanList.add(vvb);
		}
	}

	public void setIntro(String intro) {
		this.introContent = intro;
	}

	public String getIntro() {
		return introContent;
	}

	public void setPath(String path) {
		this.path = path == null ? null : path.trim();
	}

	public Vodpart getmovieType() {
		return movieType;
	}
}